package com.stox.shared.indicator.model;

import com.stox.shared.indicator.model.intf.Value;

public class StochasticValue implements Value {

	private final Double k;
	private final Double d;
	
	public StochasticValue(final Double k, final Double d) {
		this.k = k;
		this.d = d;
	}
	
	public Double getD() {
		return d;
	}
	
	public Double getK() {
		return k;
	}
	
	@Override
	public Double realValue() {
		return k;
	}

	@Override
	public Double getMax() {
		return null == k ? (null == d ? null : d) : (null == d ? k : Math.max(k, d));
	}

	@Override
	public Double getMin() {
		return null == k ? (null == d ? null : d) : (null == d ? k : Math.min(k, d));
	}

}
